package com.example.test.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.example.test.fragment.MusicFragment;

public class MyReceiver extends BroadcastReceiver {

    private static final String TAG = "MyReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals("com.notify.pause")){
            MusicFragment.handler.sendEmptyMessage(101);
        }else if (action.equals("com.notify.restart")){
            MusicFragment.handler.sendEmptyMessage(102);
        }else if (action.equals("com.notify.back")){
            MusicFragment.handler.sendEmptyMessage(103);
        }else if (action.equals("com.notify.next")){
            MusicFragment.handler.sendEmptyMessage(104);
        }
    }
}
